<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
<script>
function css()
{
	if(arguments.length==2)	//获取
	{
		return arguments[0].style[arguments[1]];
	}
	else
	{
		arguments[0].style[arguments[1]]=arguments[2];
	}
}

window.onload=function ()
{
	var oDiv=document.getElementById('div1');
	
	//alert(css(oDiv, 'width'));
	
	css(oDiv, 'background', 'green');
};
</script>
</head>

<body>
<div id="div1" style="width:200px; height:200px; background:red;">
</div>
</body>
</html>
